Skip to content

🧱 [infra] Added ty and upgraded dependencies#19

Merged
davidbrownell merged 1 commit intomainfrom
Dependencies
Apr 2, 2026
Merged

🧱 [infra] Added ty and upgraded dependencies#19
davidbrownell merged 1 commit intomainfrom
Dependencies

Conversation

@davidbrownell
Copy link
Copy Markdown
Owner

📝 Description

Added ty and upgraded dependencies.

⚙️ Work Item

N/A

🎥 Demo

N/A

Copilot AI review requested due to automatic review settings April 2, 2026 18:53
@davidbrownell davidbrownell merged commit 667dab2 into main Apr 2, 2026
38 checks passed
@davidbrownell davidbrownell deleted the Dependencies branch April 2, 2026 18:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces ty static type checking to the project’s development workflow and updates a few code locations to satisfy (or suppress) new ty-reported typing issues, alongside a small CLI default fix and dependency updates.

Changes:

  • Add ty to dev dependencies, docs, and pre-commit hooks (uv run ty check).
  • Update a Typer CLI argument default to use the Command enum value directly.
  • Add/adjust inline type-suppression comments and assertions to address new type-checking feedback.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/dbrownell_CommitEmojis/MainApp.py Adds assertions for row selection typing and updates ty ignore on DataTable row key usage.
src/dbrownell_CommitEmojis/Lib.py Adds ty ignores for Rich API typing mismatches.
src/dbrownell_CommitEmojis/main.py Uses Command.UX as the default instead of a raw string.
README.md Adds a ty status badge.
pyproject.toml Upgrades uv_build constraint and adds ty to the dev dependency group.
DEVELOPMENT.md Documents running uv run ty check.
.pre-commit-config.yaml Adds a pre-commit hook to run uv run ty check.
.copier-answers.yml Enables install_ty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 157 to 161
table.add_column(
col_name,
footer or "",
justify=justify,
justify=justify, # ty: ignore[invalid-argument-type]
)
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # ty: ignore[invalid-argument-type] on Table.add_column(..., justify=...) bypasses type checking for this call. A more robust fix is to type justify as Rich’s expected literal type (or cast it to that type) so ty can still validate the rest of the call.

Copilot uses AI. Check for mistakes.
Comment on lines 260 to 262
with done_manager_or_console.YieldStdout() as stdout_stream:
console = Console(file=stdout_stream.stream)
console = Console(file=stdout_stream.stream) # ty: ignore[invalid-argument-type]
yield console
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # ty: ignore[invalid-argument-type] on Console(file=stdout_stream.stream) hides a type mismatch that could indicate the stream isn’t the text IO Rich expects. Prefer adapting or casting stdout_stream.stream to the appropriate TextIO/IO[str] type (or updating the DoneManager type hints) so ty can validate this call without an ignore.

Copilot uses AI. Check for mistakes.
Comment on lines 198 to 204
dt.add_row(
item.code,
item.name,
item.description,
", ".join(item.aliases),
key=(item.emoji, item.aliases[0] if item.aliases else ""), # type: ignore[arg-type]
key=(item.emoji, item.aliases[0] if item.aliases else ""), # ty: ignore[invalid-argument-type]
)
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using # ty: ignore[invalid-argument-type] on the DataTable.add_row(..., key=...) call reduces the value of adding ty here. If Textual expects a specific key type, consider switching the key to that type (e.g., str/RowKey) and keeping a separate mapping to (emoji, alias) instead of storing a tuple in the key.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants